package com.webbei.Backstage.action;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Set;

import com.webbei.Backstage.service.BackstateSer;
import com.webbei.pojo.Customer;
import com.webbei.pojo.Label;

public class getAllDesignProjectAction {
	private BackstateSer bao;
	private List<Label> labellist;
	private List<Customer> customers;
	
	public String execute(){
		customers=new ArrayList<Customer>();
		labellist=bao.getAllLabelAndIsReviewzero();
		System.out.println(labellist);
		Set<String> set=new HashSet<String>();
		for(Label l:labellist){
			set.add(l.getOwner());
		}
		Iterator<String> ite=set.iterator();
		while(ite.hasNext()){
			customers.add(bao.getCustomerByUsername(ite.next()));
		}
		System.out.println(customers);
		return "success";
	}
	public BackstateSer getBao() {
		return bao;
	}
	public void setBao(BackstateSer bao) {
		this.bao = bao;
	}
	public List<Label> getLabellist() {
		return labellist;
	}
	public void setLabellist(List<Label> labellist) {
		this.labellist = labellist;
	}
	public List<Customer> getCustomers() {
		return customers;
	}
	public void setCustomers(List<Customer> customers) {
		this.customers = customers;
	}
	
}
